package qc.module.duty.mapper;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import qc.module.duty.dto.team.DutyTeamMemberDto;
import qc.module.duty.entity.DutyTeamMember;

import java.util.List;

@Mapper
public interface DutyTeamMemberMapper {
    DutyTeamMemberMapper MAPPER = Mappers.getMapper(DutyTeamMemberMapper.class);

    @Mapping(target = "memberid", source = "member")
    @Mapping(target = "member", ignore = true)
    DutyTeamMemberDto toTeamMemberDto ( DutyTeamMember en);

    @Mapping(target = "member", source = "memberid")
    DutyTeamMember toEntity(DutyTeamMemberDto dto);

    List<DutyTeamMemberDto> toTeamMemberDtoList(List<DutyTeamMember> list);
}
